package com.sojson.util.xml;

import java.util.Map;

import com.sojson.util.xml.impl.XmlUtilImpl;

/**
 * Xml工具类
 * 
 * @author liu
 * @date 2020-10-21
 */
public class XmlUtil {

    private static final XmlUtilInterface XML_UTIL_INTERFACE = XmlUtilImpl.getInstances();

    /**
     * 将Map转为Xml格式字符串
     * 
     * @param map Map集合
     * @return
     * @throws Exception 
     */
    public static String mapToXml(Map<String, Object> map) throws Exception {
        return XML_UTIL_INTERFACE.mapToXml(map);
    }

    /**
     * 将Xml格式字符串转为Map
     * 
     * @param content Xml格式字符串
     * @return
     * @throws Exception 
     */
    public static Map<String, String> xmlToMap(String content) throws Exception {
        return XML_UTIL_INTERFACE.xmlToMap(content);
    }

}